package com.lyl.momanapp.face.utils;

import com.lyl.momanapp.bean.CJBean;
import com.xps.face.bean.FaceDetectResp;
import com.xps.face.entities.PointSimple;

import java.math.BigDecimal;
import java.util.LinkedList;

/**
 * 名字 梁亚龙
 * 时间 2017/11/3.
 * QQ邮箱 503934353@qq.com
 */

public class ConvertUtils {
    private static String TAG = "ConvertUtils";
    public static final int REFERENCE_WIDTH = 480;
    public static final int REFERENCE_HEIGHT = 640;

    public ConvertUtils() {
    }

    public static float convertWidth(int inPixle, int width) {
        float ratio = Float.valueOf((float) width).floatValue() / 480.0F;
        float ff = (float) inPixle * RHU(ratio);
        return ff;
    }

    public static float convertHeight(int inPixle, int height) {
        float ratio = Float.valueOf((float) height).floatValue() / 640.0F;
        float ff = (float) inPixle * RHU(ratio);
        return ff;
    }

    public static int reverseWidth(int pixleInScreen, int width) {
        float ratio = Float.valueOf((float) width).floatValue() / 480.0F;
        return (int) ((float) pixleInScreen / RHU(ratio));
    }

    public static int reverseHeight(int pixleInScreen, int height) {
        float ratio = Float.valueOf((float) height).floatValue() / 640.0F;
        return (int) ((float) pixleInScreen / RHU(ratio));
    }

    private static float RHU(float ratio) {
        BigDecimal bd = new BigDecimal((double) ratio);
        return bd.setScale(1, 4).floatValue();
    }

    public static String getRawPoints(FaceDetectResp.FacesBean.LandmarkBean landmarkBean) {
        StringBuilder sb = new StringBuilder();
        sb.append("{\"data\":[");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_left().getX()), String.valueOf(landmarkBean.getNose_left().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_right().getX()), String.valueOf(landmarkBean.getNose_right().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eye_top().getX()), String.valueOf(landmarkBean.getLeft_eye_top().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eye_upper_left_quarter().getX()), String.valueOf(landmarkBean.getLeft_eye_upper_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eye_left_corner().getX()), String.valueOf(landmarkBean.getLeft_eye_left_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eyebrow_lower_left_quarter().getX()), String.valueOf(landmarkBean.getLeft_eyebrow_lower_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eye_bottom().getX()), String.valueOf(landmarkBean.getLeft_eye_bottom().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eye_upper_right_quarter().getX()), String.valueOf(landmarkBean.getLeft_eye_upper_right_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eye_right_corner().getX()), String.valueOf(landmarkBean.getLeft_eye_right_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eye_lower_right_quarter().getX()), String.valueOf(landmarkBean.getLeft_eye_lower_right_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eye_top().getX()), String.valueOf(landmarkBean.getRight_eye_top().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eye_upper_left_quarter().getX()), String.valueOf(landmarkBean.getRight_eye_upper_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eye_left_corner().getX()), String.valueOf(landmarkBean.getRight_eye_left_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eyebrow_lower_left_quarter().getX()), String.valueOf(landmarkBean.getRight_eyebrow_lower_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eye_bottom().getX()), String.valueOf(landmarkBean.getRight_eye_bottom().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eye_upper_right_quarter().getX()), String.valueOf(landmarkBean.getRight_eye_upper_right_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eye_right_corner().getX()), String.valueOf(landmarkBean.getRight_eye_right_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eye_lower_right_quarter().getX()), String.valueOf(landmarkBean.getRight_eye_lower_right_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_left_corner().getX()), String.valueOf(landmarkBean.getMouth_left_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_right_corner().getX()), String.valueOf(landmarkBean.getMouth_right_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_left1().getX()), String.valueOf(landmarkBean.getContour_left1().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_left2().getX()), String.valueOf(landmarkBean.getContour_left2().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_left3().getX()), String.valueOf(landmarkBean.getContour_left3().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_left4().getX()), String.valueOf(landmarkBean.getContour_left4().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_left5().getX()), String.valueOf(landmarkBean.getContour_left5().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_left6().getX()), String.valueOf(landmarkBean.getContour_left6().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_left7().getX()), String.valueOf(landmarkBean.getContour_left7().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_left8().getX()), String.valueOf(landmarkBean.getContour_left8().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_left9().getX()), String.valueOf(landmarkBean.getContour_left9().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_right1().getX()), String.valueOf(landmarkBean.getContour_right1().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_right2().getX()), String.valueOf(landmarkBean.getContour_right2().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_right3().getX()), String.valueOf(landmarkBean.getContour_right3().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_right4().getX()), String.valueOf(landmarkBean.getContour_right4().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_right5().getX()), String.valueOf(landmarkBean.getContour_right5().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_right6().getX()), String.valueOf(landmarkBean.getContour_right6().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_right7().getX()), String.valueOf(landmarkBean.getContour_right7().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_right8().getX()), String.valueOf(landmarkBean.getContour_right8().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_right9().getX()), String.valueOf(landmarkBean.getContour_right9().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getContour_chin().getX()), String.valueOf(landmarkBean.getContour_chin().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eyebrow_left_corner().getX()), String.valueOf(landmarkBean.getLeft_eyebrow_left_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eyebrow_lower_left_quarter().getX()), String.valueOf(landmarkBean.getLeft_eyebrow_lower_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eyebrow_lower_middle().getX()), String.valueOf(landmarkBean.getLeft_eyebrow_lower_middle().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eyebrow_lower_right_quarter().getX()), String.valueOf(landmarkBean.getLeft_eyebrow_lower_right_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eyebrow_right_corner().getX()), String.valueOf(landmarkBean.getLeft_eyebrow_right_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eyebrow_left_corner().getX()), String.valueOf(landmarkBean.getRight_eyebrow_left_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eyebrow_lower_left_quarter().getX()), String.valueOf(landmarkBean.getRight_eyebrow_lower_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eyebrow_lower_middle().getX()), String.valueOf(landmarkBean.getRight_eyebrow_lower_middle().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eyebrow_lower_right_quarter().getX()), String.valueOf(landmarkBean.getRight_eyebrow_lower_right_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eyebrow_right_corner().getX()), String.valueOf(landmarkBean.getRight_eyebrow_right_corner().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eyebrow_upper_left_quarter().getX()), String.valueOf(landmarkBean.getLeft_eyebrow_upper_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eyebrow_upper_middle().getX()), String.valueOf(landmarkBean.getLeft_eyebrow_upper_middle().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eyebrow_upper_right_quarter().getX()), String.valueOf(landmarkBean.getLeft_eyebrow_upper_right_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eyebrow_upper_left_quarter().getX()), String.valueOf(landmarkBean.getRight_eyebrow_upper_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eyebrow_upper_middle().getX()), String.valueOf(landmarkBean.getRight_eyebrow_upper_middle().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eyebrow_upper_right_quarter().getX()), String.valueOf(landmarkBean.getRight_eyebrow_upper_right_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getRight_eye_lower_left_quarter().getX()), String.valueOf(landmarkBean.getRight_eye_lower_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getLeft_eye_lower_left_quarter().getX()), String.valueOf(landmarkBean.getLeft_eye_lower_left_quarter().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_contour_left1().getX()), String.valueOf(landmarkBean.getNose_contour_left1().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_contour_left2().getX()), String.valueOf(landmarkBean.getNose_contour_left2().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_contour_left3().getX()), String.valueOf(landmarkBean.getNose_contour_left3().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_contour_lower_middle().getX()), String.valueOf(landmarkBean.getNose_contour_lower_middle().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_contour_right1().getX()), String.valueOf(landmarkBean.getNose_contour_right1().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_contour_right2().getX()), String.valueOf(landmarkBean.getNose_contour_right2().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_contour_right3().getX()), String.valueOf(landmarkBean.getNose_contour_right3().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_lower_lip_left_contour2().getX()), String.valueOf(landmarkBean.getMouth_lower_lip_left_contour2().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_lower_lip_left_contour3().getX()), String.valueOf(landmarkBean.getMouth_lower_lip_left_contour3().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_lower_lip_bottom().getX()), String.valueOf(landmarkBean.getMouth_lower_lip_bottom().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_lower_lip_right_contour3().getX()), String.valueOf(landmarkBean.getMouth_lower_lip_right_contour3().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_lower_lip_right_contour2().getX()), String.valueOf(landmarkBean.getMouth_lower_lip_right_contour2().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_upper_lip_right_contour2().getX()), String.valueOf(landmarkBean.getMouth_upper_lip_right_contour2().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_upper_lip_right_contour1().getX()), String.valueOf(landmarkBean.getMouth_upper_lip_right_contour1().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_upper_lip_top().getX()), String.valueOf(landmarkBean.getMouth_upper_lip_top().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_upper_lip_left_contour1().getX()), String.valueOf(landmarkBean.getMouth_upper_lip_left_contour1().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getMouth_upper_lip_left_contour2().getX()), String.valueOf(landmarkBean.getMouth_upper_lip_left_contour2().getY())));
        sb.append(",");
        sb.append(wrapPoint(String.valueOf(landmarkBean.getNose_tip().getX()), String.valueOf(landmarkBean.getNose_tip().getY())));
        sb.append("]}");
        return sb.toString();
    }

    public static LinkedList<PointSimple> getPoints(FaceDetectResp.FacesBean.LandmarkBean landmarkBean, int screenWidth, int screenHeight) {
        LinkedList pointSimples = new LinkedList();
        PointSimple contour_left1 = new PointSimple();
        contour_left1.width_scale = (float) landmarkBean.getContour_left1().getX();
        contour_left1.height_scale = (float) landmarkBean.getContour_left1().getY();
        PointSimple contour_left2 = new PointSimple();
        contour_left2.width_scale = (float) landmarkBean.getContour_left2().getX();
        contour_left2.height_scale = (float) landmarkBean.getContour_left2().getY();
        PointSimple contour_left3 = new PointSimple();
        contour_left3.width_scale = (float) landmarkBean.getContour_left3().getX();
        contour_left3.height_scale = (float) landmarkBean.getContour_left3().getY();
        PointSimple contour_left4 = new PointSimple();
        contour_left4.width_scale = (float) landmarkBean.getContour_left4().getX();
        contour_left4.height_scale = (float) landmarkBean.getContour_left4().getY();
        PointSimple contour_left5 = new PointSimple();
        contour_left5.width_scale = (float) landmarkBean.getContour_left5().getX();
        contour_left5.height_scale = (float) landmarkBean.getContour_left5().getY();
        PointSimple contour_left6 = new PointSimple();
        contour_left6.width_scale = (float) landmarkBean.getContour_left6().getX();
        contour_left6.height_scale = (float) landmarkBean.getContour_left6().getY();
        PointSimple contour_left7 = new PointSimple();
        contour_left7.width_scale = (float) landmarkBean.getContour_left7().getX();
        contour_left7.height_scale = (float) landmarkBean.getContour_left7().getY();
        PointSimple contour_left8 = new PointSimple();
        contour_left8.width_scale = (float) landmarkBean.getContour_left8().getX();
        contour_left8.height_scale = (float) landmarkBean.getContour_left8().getY();
        PointSimple contour_left9 = new PointSimple();
        contour_left9.width_scale = (float) landmarkBean.getContour_left9().getX();
        contour_left9.height_scale = (float) landmarkBean.getContour_left9().getY();
        PointSimple contour_right1 = new PointSimple();
        contour_right1.width_scale = (float) landmarkBean.getContour_right1().getX();
        contour_right1.height_scale = (float) landmarkBean.getContour_right1().getY();
        PointSimple contour_right2 = new PointSimple();
        contour_right2.width_scale = (float) landmarkBean.getContour_right2().getX();
        contour_right2.height_scale = (float) landmarkBean.getContour_right2().getY();
        PointSimple contour_right3 = new PointSimple();
        contour_right3.width_scale = (float) landmarkBean.getContour_right3().getX();
        contour_right3.height_scale = (float) landmarkBean.getContour_right3().getY();
        PointSimple contour_right4 = new PointSimple();
        contour_right4.width_scale = (float) landmarkBean.getContour_right4().getX();
        contour_right4.height_scale = (float) landmarkBean.getContour_right4().getY();
        PointSimple contour_right5 = new PointSimple();
        contour_right5.width_scale = (float) landmarkBean.getContour_right5().getX();
        contour_right5.height_scale = (float) landmarkBean.getContour_right5().getY();
        PointSimple contour_right6 = new PointSimple();
        contour_right6.width_scale = (float) landmarkBean.getContour_right6().getX();
        contour_right6.height_scale = (float) landmarkBean.getContour_right6().getY();
        PointSimple contour_right7 = new PointSimple();
        contour_right7.width_scale = (float) landmarkBean.getContour_right7().getX();
        contour_right7.height_scale = (float) landmarkBean.getContour_right7().getY();
        PointSimple contour_right8 = new PointSimple();
        contour_right8.width_scale = (float) landmarkBean.getContour_right8().getX();
        contour_right8.height_scale = (float) landmarkBean.getContour_right8().getY();
        PointSimple contour_right9 = new PointSimple();
        contour_right9.width_scale = (float) landmarkBean.getContour_right9().getX();
        contour_right9.height_scale = (float) landmarkBean.getContour_right9().getY();
        PointSimple contour_chin = new PointSimple();
        contour_chin.width_scale = (float) landmarkBean.getContour_chin().getX();
        contour_chin.height_scale = (float) landmarkBean.getContour_chin().getY();
        PointSimple left_eyebrow_left_corner = new PointSimple();
        left_eyebrow_left_corner.width_scale = (float) landmarkBean.getLeft_eyebrow_left_corner().getX();
        left_eyebrow_left_corner.height_scale = (float) landmarkBean.getLeft_eyebrow_left_corner().getY();
        PointSimple left_eyebrow_lower_left_quarter = new PointSimple();
        left_eyebrow_lower_left_quarter.width_scale = (float) landmarkBean.getLeft_eyebrow_lower_left_quarter().getX();
        left_eyebrow_lower_left_quarter.height_scale = (float) landmarkBean.getLeft_eyebrow_lower_left_quarter().getY();
        PointSimple left_eyebrow_lower_middle = new PointSimple();
        left_eyebrow_lower_middle.width_scale = (float) landmarkBean.getLeft_eyebrow_lower_middle().getX();
        left_eyebrow_lower_middle.height_scale = (float) landmarkBean.getLeft_eyebrow_lower_middle().getY();
        PointSimple left_eyebrow_lower_right_quarter = new PointSimple();
        left_eyebrow_lower_right_quarter.width_scale = (float) landmarkBean.getLeft_eyebrow_lower_right_quarter().getX();
        left_eyebrow_lower_right_quarter.height_scale = (float) landmarkBean.getLeft_eyebrow_lower_right_quarter().getY();
        PointSimple left_eyebrow_right_corner = new PointSimple();
        left_eyebrow_right_corner.width_scale = (float) landmarkBean.getLeft_eyebrow_right_corner().getX();
        left_eyebrow_right_corner.height_scale = (float) landmarkBean.getLeft_eyebrow_right_corner().getY();
        PointSimple right_eyebrow_left_corner = new PointSimple();
        right_eyebrow_left_corner.width_scale = (float) landmarkBean.getRight_eyebrow_left_corner().getX();
        right_eyebrow_left_corner.height_scale = (float) landmarkBean.getRight_eyebrow_left_corner().getY();
        PointSimple right_eyebrow_lower_left_quarter = new PointSimple();
        right_eyebrow_lower_left_quarter.width_scale = (float) landmarkBean.getRight_eyebrow_lower_left_quarter().getX();
        right_eyebrow_lower_left_quarter.height_scale = (float) landmarkBean.getRight_eyebrow_lower_left_quarter().getY();
        PointSimple right_eyebrow_lower_middle = new PointSimple();
        right_eyebrow_lower_middle.width_scale = (float) landmarkBean.getRight_eyebrow_lower_middle().getX();
        right_eyebrow_lower_middle.height_scale = (float) landmarkBean.getRight_eyebrow_lower_middle().getY();
        PointSimple right_eyebrow_lower_right_quarter = new PointSimple();
        right_eyebrow_lower_right_quarter.width_scale = (float) landmarkBean.getRight_eyebrow_lower_right_quarter().getX();
        right_eyebrow_lower_right_quarter.height_scale = (float) landmarkBean.getRight_eyebrow_lower_right_quarter().getY();
        PointSimple right_eyebrow_right_corner = new PointSimple();
        right_eyebrow_right_corner.width_scale = (float) landmarkBean.getRight_eyebrow_right_corner().getX();
        right_eyebrow_right_corner.height_scale = (float) landmarkBean.getRight_eyebrow_right_corner().getY();
        PointSimple left_eyebrow_upper_right_quarter = new PointSimple();
        left_eyebrow_upper_right_quarter.width_scale = (float) landmarkBean.getLeft_eyebrow_upper_right_quarter().getX();
        left_eyebrow_upper_right_quarter.height_scale = (float) landmarkBean.getLeft_eyebrow_upper_right_quarter().getY();
        PointSimple left_eyebrow_upper_middle = new PointSimple();
        left_eyebrow_upper_middle.width_scale = (float) landmarkBean.getLeft_eyebrow_upper_middle().getX();
        left_eyebrow_upper_middle.height_scale = (float) landmarkBean.getLeft_eyebrow_upper_middle().getY();
        PointSimple left_eyebrow_upper_left_quarter = new PointSimple();
        left_eyebrow_upper_left_quarter.width_scale = (float) landmarkBean.getLeft_eyebrow_upper_left_quarter().getX();
        left_eyebrow_upper_left_quarter.height_scale = (float) landmarkBean.getLeft_eyebrow_upper_left_quarter().getY();
        PointSimple right_eyebrow_upper_right_quarter = new PointSimple();
        right_eyebrow_upper_right_quarter.width_scale = (float) landmarkBean.getRight_eyebrow_upper_right_quarter().getX();
        right_eyebrow_upper_right_quarter.height_scale = (float) landmarkBean.getRight_eyebrow_upper_right_quarter().getY();
        PointSimple right_eyebrow_upper_middle = new PointSimple();
        right_eyebrow_upper_middle.width_scale = (float) landmarkBean.getRight_eyebrow_upper_middle().getX();
        right_eyebrow_upper_middle.height_scale = (float) landmarkBean.getRight_eyebrow_upper_middle().getY();
        PointSimple right_eyebrow_upper_left_quarter = new PointSimple();
        right_eyebrow_upper_left_quarter.width_scale = (float) landmarkBean.getRight_eyebrow_upper_left_quarter().getX();
        right_eyebrow_upper_left_quarter.height_scale = (float) landmarkBean.getRight_eyebrow_upper_left_quarter().getY();
        PointSimple right_eye_bottom = new PointSimple();
        right_eye_bottom.width_scale = (float) landmarkBean.getRight_eye_bottom().getX();
        right_eye_bottom.height_scale = (float) landmarkBean.getRight_eye_bottom().getY();
        PointSimple right_eye_left_corner = new PointSimple();
        right_eye_left_corner.width_scale = (float) landmarkBean.getRight_eye_left_corner().getX();
        right_eye_left_corner.height_scale = (float) landmarkBean.getRight_eye_left_corner().getY();
        PointSimple right_eye_lower_left_quarter = new PointSimple();
        right_eye_lower_left_quarter.width_scale = (float) landmarkBean.getRight_eye_lower_left_quarter().getX();
        right_eye_lower_left_quarter.height_scale = (float) landmarkBean.getRight_eye_lower_left_quarter().getY();
        PointSimple right_eye_lower_right_quarter = new PointSimple();
        right_eye_lower_right_quarter.width_scale = (float) landmarkBean.getRight_eye_lower_right_quarter().getX();
        right_eye_lower_right_quarter.height_scale = (float) landmarkBean.getRight_eye_lower_right_quarter().getY();
        PointSimple right_eye_right_corner = new PointSimple();
        right_eye_right_corner.width_scale = (float) landmarkBean.getRight_eye_right_corner().getX();
        right_eye_right_corner.height_scale = (float) landmarkBean.getRight_eye_right_corner().getY();
        PointSimple right_eye_top = new PointSimple();
        right_eye_top.width_scale = (float) landmarkBean.getRight_eye_top().getX();
        right_eye_top.height_scale = (float) landmarkBean.getRight_eye_top().getY();
        PointSimple right_eye_upper_left_quarter = new PointSimple();
        right_eye_upper_left_quarter.width_scale = (float) landmarkBean.getRight_eye_upper_left_quarter().getX();
        right_eye_upper_left_quarter.height_scale = (float) landmarkBean.getRight_eye_upper_left_quarter().getY();
        PointSimple right_eye_upper_right_quarter = new PointSimple();
        right_eye_upper_right_quarter.width_scale = (float) landmarkBean.getRight_eye_upper_right_quarter().getX();
        right_eye_upper_right_quarter.height_scale = (float) landmarkBean.getRight_eye_upper_right_quarter().getY();
        PointSimple left_eye_bottom = new PointSimple();
        left_eye_bottom.width_scale = (float) landmarkBean.getLeft_eye_bottom().getX();
        left_eye_bottom.height_scale = (float) landmarkBean.getLeft_eye_bottom().getY();
        PointSimple left_eye_left_corner = new PointSimple();
        left_eye_left_corner.width_scale = (float) landmarkBean.getLeft_eye_left_corner().getX();
        left_eye_left_corner.height_scale = (float) landmarkBean.getLeft_eye_left_corner().getY();
        PointSimple left_eye_lower_left_quarter = new PointSimple();
        left_eye_lower_left_quarter.width_scale = (float) landmarkBean.getLeft_eye_lower_left_quarter().getX();
        left_eye_lower_left_quarter.height_scale = (float) landmarkBean.getLeft_eye_lower_left_quarter().getY();
        PointSimple left_eye_lower_right_quarter = new PointSimple();
        left_eye_lower_right_quarter.width_scale = (float) landmarkBean.getLeft_eye_lower_right_quarter().getX();
        left_eye_lower_right_quarter.height_scale = (float) landmarkBean.getLeft_eye_lower_right_quarter().getY();
        PointSimple left_eye_right_corner = new PointSimple();
        left_eye_right_corner.width_scale = (float) landmarkBean.getLeft_eye_right_corner().getX();
        left_eye_right_corner.height_scale = (float) landmarkBean.getLeft_eye_right_corner().getY();
        PointSimple left_eye_top = new PointSimple();
        left_eye_top.width_scale = (float) landmarkBean.getLeft_eye_top().getX();
        left_eye_top.height_scale = (float) landmarkBean.getLeft_eye_top().getY();
        PointSimple left_eye_upper_left_quarter = new PointSimple();
        left_eye_upper_left_quarter.width_scale = (float) landmarkBean.getLeft_eye_upper_left_quarter().getX();
        left_eye_upper_left_quarter.height_scale = (float) landmarkBean.getLeft_eye_upper_left_quarter().getY();
        PointSimple left_eye_upper_right_quarter = new PointSimple();
        left_eye_upper_right_quarter.width_scale = (float) landmarkBean.getLeft_eye_upper_right_quarter().getX();
        left_eye_upper_right_quarter.height_scale = (float) landmarkBean.getLeft_eye_upper_right_quarter().getY();
        PointSimple nose_contour_left1 = new PointSimple();
        nose_contour_left1.width_scale = (float) landmarkBean.getNose_contour_left1().getX();
        nose_contour_left1.height_scale = (float) landmarkBean.getNose_contour_left1().getY();
        PointSimple nose_contour_left2 = new PointSimple();
        nose_contour_left2.width_scale = (float) landmarkBean.getNose_contour_left2().getX();
        nose_contour_left2.height_scale = (float) landmarkBean.getNose_contour_left2().getY();
        PointSimple nose_contour_left3 = new PointSimple();
        nose_contour_left3.width_scale = (float) landmarkBean.getNose_contour_left3().getX();
        nose_contour_left3.height_scale = (float) landmarkBean.getNose_contour_left3().getY();
        PointSimple nose_contour_lower_middle = new PointSimple();
        nose_contour_lower_middle.width_scale = (float) landmarkBean.getNose_contour_lower_middle().getX();
        nose_contour_lower_middle.height_scale = (float) landmarkBean.getNose_contour_lower_middle().getY();
        PointSimple nose_contour_right1 = new PointSimple();
        nose_contour_right1.width_scale = (float) landmarkBean.getNose_contour_right1().getX();
        nose_contour_right1.height_scale = (float) landmarkBean.getNose_contour_right1().getY();
        PointSimple nose_contour_right2 = new PointSimple();
        nose_contour_right2.width_scale = (float) landmarkBean.getNose_contour_right2().getX();
        nose_contour_right2.height_scale = (float) landmarkBean.getNose_contour_right2().getY();
        PointSimple nose_contour_right3 = new PointSimple();
        nose_contour_right3.width_scale = (float) landmarkBean.getNose_contour_right3().getX();
        nose_contour_right3.height_scale = (float) landmarkBean.getNose_contour_right3().getY();
        PointSimple nose_left = new PointSimple();
        nose_left.width_scale = (float) landmarkBean.getNose_left().getX();
        nose_left.height_scale = (float) landmarkBean.getNose_left().getY();
        PointSimple nose_right = new PointSimple();
        nose_right.width_scale = (float) landmarkBean.getNose_right().getX();
        nose_right.height_scale = (float) landmarkBean.getNose_right().getY();
        PointSimple mouth_left_corner = new PointSimple();
        mouth_left_corner.width_scale = (float) landmarkBean.getMouth_left_corner().getX();
        mouth_left_corner.height_scale = (float) landmarkBean.getMouth_left_corner().getY();
        PointSimple mouth_lower_lip_left_contour2 = new PointSimple();
        mouth_lower_lip_left_contour2.width_scale = (float) landmarkBean.getMouth_lower_lip_left_contour2().getX();
        mouth_lower_lip_left_contour2.height_scale = (float) landmarkBean.getMouth_lower_lip_left_contour2().getY();
        PointSimple mouth_lower_lip_left_contour3 = new PointSimple();
        mouth_lower_lip_left_contour3.width_scale = (float) landmarkBean.getMouth_lower_lip_left_contour3().getX();
        mouth_lower_lip_left_contour3.height_scale = (float) landmarkBean.getMouth_lower_lip_left_contour3().getY();
        PointSimple mouth_lower_lip_bottom = new PointSimple();
        mouth_lower_lip_bottom.width_scale = (float) landmarkBean.getMouth_lower_lip_bottom().getX();
        mouth_lower_lip_bottom.height_scale = (float) landmarkBean.getMouth_lower_lip_bottom().getY();
        PointSimple mouth_lower_lip_right_contour3 = new PointSimple();
        mouth_lower_lip_right_contour3.width_scale = (float) landmarkBean.getMouth_lower_lip_right_contour3().getX();
        mouth_lower_lip_right_contour3.height_scale = (float) landmarkBean.getMouth_lower_lip_right_contour3().getY();
        PointSimple mouth_lower_lip_right_contour2 = new PointSimple();
        mouth_lower_lip_right_contour2.width_scale = (float) landmarkBean.getMouth_lower_lip_right_contour2().getX();
        mouth_lower_lip_right_contour2.height_scale = (float) landmarkBean.getMouth_lower_lip_right_contour2().getY();
        PointSimple mouth_right_corner = new PointSimple();
        mouth_right_corner.width_scale = (float) landmarkBean.getMouth_right_corner().getX();
        mouth_right_corner.height_scale = (float) landmarkBean.getMouth_right_corner().getY();
        PointSimple mouth_upper_lip_right_contour2 = new PointSimple();
        mouth_upper_lip_right_contour2.width_scale = (float) landmarkBean.getMouth_upper_lip_right_contour2().getX();
        mouth_upper_lip_right_contour2.height_scale = (float) landmarkBean.getMouth_upper_lip_right_contour2().getY();
        PointSimple mouth_upper_lip_right_contour1 = new PointSimple();
        mouth_upper_lip_right_contour1.width_scale = (float) landmarkBean.getMouth_upper_lip_right_contour1().getX();
        mouth_upper_lip_right_contour1.height_scale = (float) landmarkBean.getMouth_upper_lip_right_contour1().getY();
        PointSimple mouth_upper_lip_top = new PointSimple();
        mouth_upper_lip_top.width_scale = (float) landmarkBean.getMouth_upper_lip_top().getX();
        mouth_upper_lip_top.height_scale = (float) landmarkBean.getMouth_upper_lip_top().getY();
        PointSimple mouth_upper_lip_left_contour1 = new PointSimple();
        mouth_upper_lip_left_contour1.width_scale = (float) landmarkBean.getMouth_upper_lip_left_contour1().getX();
        mouth_upper_lip_left_contour1.height_scale = (float) landmarkBean.getMouth_upper_lip_left_contour1().getY();
        PointSimple mouth_upper_lip_left_contour2 = new PointSimple();
        mouth_upper_lip_left_contour2.width_scale = (float) landmarkBean.getMouth_upper_lip_left_contour2().getX();
        mouth_upper_lip_left_contour2.height_scale = (float) landmarkBean.getMouth_upper_lip_left_contour2().getY();
        PointSimple nose_tip = new PointSimple();
        nose_tip.width_scale = (float) landmarkBean.getNose_tip().getX();
        nose_tip.height_scale = (float) landmarkBean.getNose_tip().getY();
        CJBean.startX = (float) landmarkBean.getContour_left1().getX();
        CJBean.startY = (float) landmarkBean.getLeft_eyebrow_upper_middle().getY();
        CJBean.endX = (float) landmarkBean.getContour_right1().getX();
        CJBean.endY = (float) landmarkBean.getContour_chin().getY();


        pointSimples.add(left_eyebrow_right_corner);
        pointSimples.add(left_eyebrow_upper_right_quarter);
        pointSimples.add(left_eyebrow_upper_middle);
        pointSimples.add(left_eyebrow_upper_left_quarter);
        pointSimples.add(left_eyebrow_left_corner);
        pointSimples.add(contour_left1);
        pointSimples.add(contour_left2);
        pointSimples.add(contour_left3);
        pointSimples.add(contour_left4);
        pointSimples.add(contour_left5);
        pointSimples.add(contour_left6);
        pointSimples.add(contour_left7);
        pointSimples.add(contour_left8);
        pointSimples.add(contour_left9);
        pointSimples.add(contour_chin);
        pointSimples.add(contour_right9);
        pointSimples.add(contour_right8);
        pointSimples.add(contour_right7);
        pointSimples.add(contour_right6);
        pointSimples.add(contour_right5);
        pointSimples.add(contour_right4);
        pointSimples.add(contour_right3);
        pointSimples.add(contour_right2);
        pointSimples.add(contour_right1);
        pointSimples.add(right_eyebrow_right_corner);
        pointSimples.add(right_eyebrow_upper_right_quarter);
        pointSimples.add(right_eyebrow_upper_middle);
        pointSimples.add(right_eyebrow_upper_left_quarter);
        pointSimples.add(right_eyebrow_left_corner);
        pointSimples.add(left_eyebrow_right_corner);
        return pointSimples;
    }

    private static String wrapPoint(String x, String y) {
        StringBuilder sb = new StringBuilder();
        sb.append("\"");
        sb.append(x);
        sb.append(",");
        sb.append(y);
        sb.append("\"");
        return sb.toString();
    }
}
